const API_URL = 'http://localhost:8000';
// 加载⾏星数据并返回 JSON 格式
async function httpGetPlanets() {
    const response = await fetch(`${API_URL}/planets`);
    return await response.json();
}
async function httpGetLaunches() {
    // 加载发射任务数据，按任务编号排序，然后返回 JSON 格式
    const response = await fetch(`${API_URL}/launches`);
    const fetchedLaunches = await response.json();
    return fetchedLaunches.sort((a, b) => {
    return a.flightNumber - b.flightNumber;
    });
   }